﻿//求1+2+3+...+n，要求不能使用乘除法、for、while、if、else、switch、case等关键字及条件判
//断语句
​
class Sum
{
public:
    Sum()
    {
        _i++;
        _sum += _i;
    }

    static int Get_sum()
    {
        return _sum;
    }

private:
    static int _i;
    static int _sum;

};

int Sum::_i = 0;
int Sum::_sum = 0;

class Solution
{
public:
    int Sum_Solution(int n)
    {
        Sum arr[n];
        return Sum::Get_sum();
    }
};


​